<VI syntaxVersion=11 LVversion=8508002 revision=5 name="Finite buffered counting original.vi">
<TITLE><NO_TITLE name="Finite buffered counting original.vi"></TITLE>
<HELP_PATH></HELP_PATH>
<HELP_TAG></HELP_TAG>
<RTM_PATH type="default"></RTM_PATH>
<DESC></DESC>
<CONTENT>
	<GROUPER>
		<PARTS>
		</PARTS></GROUPER>
	<CONTROL ID=80 type="Numeric" name="Samples per Channel">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
			<PART ID=82 order=0 type="Caption"><LABEL><STEXT>Samples per Channel</STEXT></LABEL></PART>
		</PARTS>
	</CONTROL>
	<CONTROL ID=148 type="DAQmx Physical Channel" name="Counter(s)">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
			<PART ID=82 order=0 type="Caption"><LABEL><STEXT>Counter(s)</STEXT></LABEL></PART>
		</PARTS>
	</CONTROL>
	<CONTROL ID=148 type="DAQmx Terminal" name="Sample Clock Source">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
			<PART ID=82 order=0 type="Caption"><LABEL><STEXT>Sample Clock Source</STEXT></LABEL></PART>
		</PARTS>
	</CONTROL>
	<CONTROL ID=148 type="DAQmx Terminal" name="ArmStart.DigEdge.Src">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
			<PART ID=82 order=0 type="Caption"><LABEL><STEXT>ArmStart.DigEdge.Src</STEXT></LABEL></PART>
		</PARTS>
	</CONTROL>
	<CONTROL ID=82 type="Array" name="data">
		<DESC><<B>>data<</B>> returns samples. Each element of the array corresponds to a sample from the task.</DESC>
		<TIP></TIP>
		<PARTS>
			<PART ID=82 order=0 type="Caption"><LABEL><STEXT>data</STEXT></LABEL></PART>
		</PARTS>
		<DEFAULT>
			<ARRAY nElems=0>
			</ARRAY>
		</DEFAULT>
		<CONTENT>
			<CONTROL ID=80 type="Numeric" name="Numeric">
				<DESC></DESC>
				<TIP></TIP>
				<PARTS>
					<PART ID=82 order=0 type="Caption"><LABEL><STEXT>Numeric</STEXT></LABEL></PART>
				</PARTS>
			</CONTROL>
		</CONTENT>
	</CONTROL>
</CONTENT>
<BDCONTENT>
	<CONTROL ID=80 type="Numeric Constant" name="index">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
		</PARTS>
	</CONTROL>
	<NODE ID=185 type="Replace Array Subset">
		<DESC></DESC>
	</NODE>
	<NODE ID=68 type="Index Array">
		<DESC></DESC>
	</NODE>
	<LABEL><STEXT>Select starting point and length of array</STEXT></LABEL>
	<CONTROL ID=80 type="Numeric Constant" name="index">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
		</PARTS>
	</CONTROL>
	<NODE ID=47 type="Function" primID=20434544 primName="Decrement">
		<DESC></DESC>
	</NODE>
	<NODE ID=32 type="For Loop">
		<DESC></DESC>
		<BDCONTENT>
			<LABEL><STEXT>change from cumulative to ""real"" counts</STEXT></LABEL>
			<NODE ID=185 type="Replace Array Subset">
				<DESC></DESC>
			</NODE>
			<NODE ID=47 type="Function" primID=20425553 primName="Subtract">
				<DESC></DESC>
			</NODE>
			<NODE ID=47 type="Function" primID=20434544 primName="Decrement">
				<DESC></DESC>
			</NODE>
			<NODE ID=68 type="Index Array">
				<DESC></DESC>
			</NODE>
			<NODE ID=47 type="Function" primID=20425553 primName="Subtract">
				<DESC></DESC>
			</NODE>
			<NODE ID=68 type="Index Array">
				<DESC></DESC>
			</NODE>
		</BDCONTENT>
	</NODE>
	<LABEL><STEXT>5.</STEXT></LABEL>
	<LABEL><STEXT>initial counts</STEXT></LABEL>
	<CONTROL ID=80 type="Numeric Constant" name="Initial Count">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
		</PARTS>
	</CONTROL>
	<CONTROL ID=80 type="Numeric Constant" name="samples per channel">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
		</PARTS>
	</CONTROL>
	<NODE ID=140 type="Property Node">
		<DESC></DESC>
	</NODE>
	<LABEL><STEXT>4.</STEXT></LABEL>
	<CONTROL ID=80 type="Numeric Constant" name="timeout">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
		</PARTS>
	</CONTROL>
	<NODE ID=197 type="PolyVI" subVIName="DAQmx Read.vi">
		<DESC></DESC>
	</NODE>
	<CONTROL ID=87 type="Ring Constant" name="ArmStart.DigEdge.Edge">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
			<PART ID=12 order=0 type="Ring Text"><MLABEL><STRINGS><STRING>Rising</STRING><STRING>Falling</STRING></STRINGS></MLABEL></PART>
		</PARTS>
	</CONTROL>
	<CONTROL ID=87 type="Ring Constant" name="ArmStart.TrigType">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
			<PART ID=12 order=0 type="Ring Text"><MLABEL><STRINGS><STRING>Digital Edge</STRING><STRING>None</STRING></STRINGS></MLABEL></PART>
		</PARTS>
	</CONTROL>
	<CONTROL ID=80 type="Numeric Constant" name="Rate">
		<DESC><<B>>rate<</B>> specifies the sampling rate in samples per second.</DESC>
		<TIP></TIP>
		<PARTS>
		</PARTS>
	</CONTROL>
	<CONTROL ID=87 type="Ring Constant" name="Edge">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
			<PART ID=12 order=0 type="Ring Text"><MLABEL><STRINGS><STRING>Rising</STRING><STRING>Falling</STRING></STRINGS></MLABEL></PART>
		</PARTS>
	</CONTROL>
	<CONTROL ID=87 type="Ring Constant" name="Count Direction">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
			<PART ID=12 order=0 type="Ring Text"><MLABEL><STRINGS><STRING>Count Up</STRING><STRING>Count Down</STRING><STRING>Externally Controlled</STRING></STRINGS></MLABEL></PART>
		</PARTS>
	</CONTROL>
	<NODE ID=49 type="SubVI" subVIName="Simple Error Handler.vi">
		<DESC></DESC>
	</NODE>
	<CONTROL ID=100 type="Type Definition" name="type of dialog (OK msg:1)">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
			<PART ID=8010 order=0 type="Type Def's Control">
				<CONTROL ID=87 type="Ring Constant" name="">
					<DESC></DESC>
					<TIP></TIP>
					<PARTS>
						<PART ID=12 order=0 type="Ring Text"><MLABEL><STRINGS><STRING>no dialog</STRING><STRING>OK message</STRING><STRING>continue or stop message</STRING><STRING>OK message + warnings</STRING><STRING>continue/stop + warnings</STRING></STRINGS></MLABEL></PART>
					</PARTS>
				</CONTROL>
			</PART>
		</PARTS>
	</CONTROL>
	<NODE ID=49 type="SubVI" subVIName="DAQmx Clear Task.vi">
		<DESC></DESC>
	</NODE>
	<LABEL><STEXT>6.</STEXT></LABEL>
	<CONTROL ID=87 type="Ring Constant" name="sample mode">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
			<PART ID=12 order=0 type="Ring Text"><MLABEL><STRINGS><STRING>Finite Samples</STRING><STRING>Continuous Samples</STRING></STRINGS></MLABEL></PART>
		</PARTS>
	</CONTROL>
	<CONTROL ID=87 type="Ring Constant" name="active edge">
		<DESC></DESC>
		<TIP></TIP>
		<PARTS>
			<PART ID=12 order=0 type="Ring Text"><MLABEL><STRINGS><STRING>Rising</STRING><STRING>Falling</STRING></STRINGS></MLABEL></PART>
		</PARTS>
	</CONTROL>
	<NODE ID=49 type="SubVI" subVIName="DAQmx Start Task.vi">
		<DESC></DESC>
	</NODE>
	<NODE ID=197 type="PolyVI" subVIName="DAQmx Create Virtual Channel.vi">
		<DESC></DESC>
	</NODE>
	<LABEL><STEXT>                                                                     ================Finite-size Buffered Counting================<LF>
 Steps: <LF>
1. Create a Counter Input channel to Count Events. The ""Arm start trigger"" property nodes determine how to start one run of counting.<LF>
<LF>
2.  Call the DAQmx Timing VI (Sample Clock) to configure the external sample clock timing parameters such as Sample Mode, Samples per Channel, and Sample Clock Source.  The Edge parameter is set to be ""falling"" to make a 500ns delay from the ""trigger"" signal (otherwise two TTL come at the same time to cause misalignment of the first channel.<LF>
* what does the ""Rate"" work?<LF>
<LF>
3.  Call the Start VI to arm the counter and begin counting.  The counter will be preloaded with the Initial Count.<LF>
<LF>
4.  For finite measurements, the counter will stop reading data when the Samples per Channel have been received.  <LF>
<LF>
5.  This finite buffered counting gives a cumulative results (does not reset to zero every time, see user manual). The ""For loop"" is used to obtain real counts belonging to each channel, by subtracting readout counts of previous channel, starting from the last channel to the first.<LF>
<LF>
6.  Call the Clear Task VI to clear the Task. Use the popup dialog box to display an error if any.</STEXT></LABEL>
	<LABEL><STEXT>3.</STEXT></LABEL>
	<LABEL><STEXT>2.</STEXT></LABEL>
	<LABEL><STEXT>1.</STEXT></LABEL>
	<NODE ID=197 type="PolyVI" subVIName="DAQmx Timing.vi">
		<DESC></DESC>
	</NODE>
</BDCONTENT>
</VI>


